home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3111 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.6 KB  |  67 lines

  1. Newsgroups: comp.lang.c
  2. Path: scn.org!bd592
  3. From: bd592@scn.org (Corey E. Tabaka)
  4. Subject: Re: Printing to LPT1 Printer from within program
  5. Message-ID: <DLrL6n.4J2@scn.org>
  6. Sender: news@scn.org
  7. Reply-To: bd592@scn.org (Corey E. Tabaka)
  8. Organization: Seattle Community Network
  9. References: <31076D63.289D@cmt.lpr.mail.carel.fi> <4e5ee9$m28_001@pr.mcs.net>
  10. Date: Fri, 26 Jan 1996 01:23:11 GMT
  11.  
  12.  
  13. In a previous article, aril@cmt.lpr.mail.carel.fi (Ari Lukumies) says:
  14.  
  15. >Michael D. Perry wrote:
  16. >> 
  17. >> I have just started taking a C programming class and am using Borland
  18. >> C++ v4.0 at home.  Both my teacher and I are stumped as to how to
  19. >> print to a LPT (Line Printer) device from within the program.
  20. >> 
  21. >> I have read the FAQ and there are some references to this but not
  22. >> enough that I can quite figure it out.  As near as I can figure you
  23. >> can use iostreams or fprintf() with the later appearing to be the
  24. >> simpler of the two.  With that, from what I have seen, one uses a
  25. >> filename of stdprn but I get an error message when compiling.  My
  26. >> guess is that there is a header file or a definition/declaration
  27. >> statement that needs to be referenced.
  28. >> [rest snipped]
  29. >
  30. >Have you tried:
  31. >
  32. >    #include    <stdio.h>
  33. >
  34. >    int    main(int argc, char **argv)
  35. >    {
  36. >        while (argc--)
  37. >            fprintf(stderr, "%s\n", *argv++);
  38. >    }
  39. >
  40. >Later,
  41. >AriL
  42. >-- 
  43. >All my opinions are mine and mine alone.
  44. >
  45.  
  46. Or you could try...
  47.  
  48.  
  49. #include <stdio.h>
  50.  
  51. int main() {
  52.  
  53. FILE *lpt1;
  54. .
  55. .
  56. .
  57.  
  58. ...lpt1=fopen("LPT1","w");
  59.  
  60.  
  61. --
  62.                                      
  63.                                           Corey Tabaka,
  64.                                         bd592@scn.org
  65.  
  66.                                          
  67.